#ifndef BLUETOOTH_H
#define BLUETOOTH_H
#define FRAME_HEAD 'L'
#define FRAME_END  'X'
#define BUFFER_SIZE     (sizeof(Bluetooth_DataFrame))
#define BLUETOOTH_NAME DX2003
#define Bluetooth_SendData(device,data) \
                        _Bluetooth_SendData(device, data, BUFFER_SIZE)


#include "usart.h"
typedef struct Bluetooth_DataFrame{
    unsigned char FrameHead;
    unsigned char Mode; //1:positive 
    unsigned char ElbowAngleL;
    unsigned char ElbowAngleH;
    unsigned char SwingAngleL;
    unsigned char SwingAngleH;
    unsigned char LiftAngleL;
    unsigned char LiftAngleH;
    unsigned char ActionID;
    unsigned char FreeFlag;
    unsigned char FrameEnd;
}Bluetooth_DataFrame;
extern USART_Device BLUETOOTH_NAME;
extern Bluetooth_DataFrame BluetoothData;
extern unsigned short bt_RecData;
void UART1_IRQHandler(void);
void _Bluetooth_SendData(USART_Device *device, Bluetooth_DataFrame *data, int buffer_size);
int Bluetooth_DataHandler(unsigned short *Data);

#endif
